package org.bookie.stateful;

import javax.servlet.http.HttpSession;



public class ConversationalClientStateStorage implements ClientStateStorage {

	private ConversationManager conversationMgr;
	
	public ConversationalClientStateStorage( ConversationManager cmgr ) {
		conversationMgr = cmgr;
	}
	
	public void provideSession(HttpSession session) {
		// not needed
	}

	public void store(String key, StateStorageClearanceListener obj) {
		conversationMgr.getCurrentConversation().put( key, obj);
	}

	public StateStorageClearanceListener retrieve(String key) {
		return (StateStorageClearanceListener) conversationMgr.getCurrentConversation().get( key );
	}

	public void clear(String clientId) {
		conversationMgr.terminateConversation();
	}

	public void setClientId(String clientId) {
		// not needed

	}

}
